package com.cxhome.cxinfox.QCellCore;

import com.jfinal.plugin.activerecord.Page;
import com.traffic.managent.annotation.ControllerBind;
import com.traffic.managent.base.CxBaseController;
import com.traffic.managent.model.system.Province;
import com.traffic.managent.util.SQLUtils;

/**
 * 省份管理
 */
@ControllerBind(controllerKey = "/system/province")
public class ProvinceController extends CxBaseController {

	private static final String path = "/pages/system/moderrouting/moderrouting_";

	public void index() {
		list();
	}

	public void list() {
		Province model = getModelByAttr(Province.class);

		SQLUtils sql = new SQLUtils(" from cx_modern_routing ca where 1=1");

		Page<Province> page = Province.dao.paginate(getPaginator(), "select ca.*  ", sql.toString().toString());

		setAttr("page", page);
		setAttr("attr", model);
		render(path + "list.html");
	}

	public void view() {
		Province model = Province.dao.findById(getPara());

		setAttr("model", model);

		render(path + "view.html");
	}

}
